﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.ReportingServices.OnDemandReportRendering;

namespace Merbla.SSRS.Components
{
    class Map : Microsoft.ReportingServices.OnDemandReportRendering.ICustomReportItem
    {
        #region ICustomReportItem Members

        public void EvaluateReportItemInstance(Microsoft.ReportingServices.OnDemandReportRendering.CustomReportItem cri)
        {
            // Create the Image Definition object that will be 
            // used to render the custom report item
            cri.CreateCriImageDefinition();
            Image polygonImage = (Image)cri.GeneratedReportItem;
        }

        public void GenerateReportItemDefinition(Microsoft.ReportingServices.OnDemandReportRendering.CustomReportItem cri)
        {
            // Get the Image definition
            Image polygonImage = (Image)cri.GeneratedReportItem;

            // Create the image for the custom report item
            polygonImage.ImageInstance.ImageData = DrawImage(cri);
        }

        private  byte[] DrawImage(Microsoft.ReportingServices.OnDemandReportRendering.CustomReportItem cri)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
